package com.jk.mapper;

import com.jk.entity.User;
import org.apache.ibatis.annotations.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by dell on 2017/6/16.
 */
@Mapper
public interface HelloMapper {

    @Select("select * from user")
    List<User> selectUserList();

    @Select("select * from user where id = #{value}")
    User selectOneUserById(Integer id);

    @Insert("insert into user(name,age) values(#{name},#{age})")
    int insertUser(User user);

    @Update("UPDATE USER SET NAME=#{name},age=#{age} WHERE id=#{id}")
    int updateUserById(User user);

    @Delete("delete from user where id=#{id}")
    int deleteUserById(Integer id);
}
